# -*- coding: utf-8 -*-
"""
-------------------------------------------------
   File Name：     container_num_post
   Description :
   Author :       'li'
   date：          2020/11/25
-------------------------------------------------
   Change Activity:
                   2020/11/25:
-------------------------------------------------
"""
import os

import requests

import ml


def main():
    paths = ml.list_file_paths_in_dir(r'D:\image\test_img\危险品')
    for p in paths:
        # p = 'D:/image/道口箱号识别/success/MSKU_842043_2__True____24a14b2c565e48a48f3c021d2509f0eb.jpg'
        _, name = os.path.split(p)
        file = {'pic': open(p, 'rb')}
        res = requests.post(url='http://10.21.16.119:8080/ocr/dangerous', files=file)
        print(f'{name}{res.text}')


if __name__ == '__main__':
    main()
